import { QXEvent } from "qx-util";
import { IParam, TabViewPanelActionType, ITabViewPanelAbility, ITabViewPanelControllerParams, ITabViewPanelStore, TabViewPanelController, ICtrlEvent, ITabViewPanelController, ITabViewPanelModel } from "@/core";
import { useTabViewPanelAction, useTabViewPanelBasic, useTabViewPanelControllerParams, useTabViewPanelProps } from "@/hooks/widget/use-tab-view-panel";
import { model } from "./s-tab-exp-viewtabviewpanel-2-tab-view-panel-model";
// 基于template/src/widgets/{{appEntities}}/{{ctrls@TABVIEWPANEL}}-use-tab-view-panel/{{spinalCase ctrl.codeName}}-use-tab-view-panel-hook.ts.hbs生成
/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useTabViewPanelProps(),
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useTabViewPanelBasic(model, props),
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
		...useTabViewPanelAction(controller),
	};
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<ICtrlEvent<TabViewPanelActionType, ITabViewPanelAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<ICtrlEvent<TabViewPanelActionType, ITabViewPanelAbility>>,
    otherParams: IParam = {},
): ITabViewPanelController<ITabViewPanelStore, ITabViewPanelAbility> {
	const params: ITabViewPanelControllerParams<TabViewPanelActionType, ITabViewPanelAbility> =
		useTabViewPanelControllerParams<ITabViewPanelStore, ITabViewPanelModel>(model, props, evt, otherParams);
  	return new TabViewPanelController(params);
}